package com.flea.repository.jdbc;

import com.flea.model.User;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

/**
 * https://docs.spring.io/spring-data/jdbc/docs/2.1.3/reference/html/#jdbc.query-methods
 * @author hc24
 * @date 2021.1.20 12:45
 */
@Repository
public interface UserRepository extends CrudRepository<User, Integer> {

    User findByLoginAndPwd(String login, String pwd);

    long countByLoginOrNickname(String login, String nickname);

    long countByEmailAndIdIsNot(String email, String id);

}
